<%@ include file="connect.jsp" %>

<%
    String pert = request.getParameter("question");
    String pilA = request.getParameter("pilA");
    String pilB = request.getParameter("pilB");
    String pilC = request.getParameter("pilC");
    String pilD = request.getParameter("pilD");
    String Ans = request.getParameter("answer");
    String idque = request.getParameter("idque");
    String idtest = request.getParameter("Testid");
    String ganti = pert.replaceAll("'", "''");
    String target = request.getParameter("option");

    stat.executeUpdate("UPDATE DetailQuestion set Answer = '" + Ans + "' , Option_1 = '" + pilA + "' , " +
            "Option_2 = '" + pilB + "' , Option_3 = '" + pilC + "' , Option_4 = '" + pilD + "' , Question = '" + ganti + "', Target = '"+target+"' where questionID = '" + idque + "' ");

    if (idtest.equals("1")) {

        response.sendRedirect("pretest.jsp?respon=Question has been updated!");
        conn.close();

    } else {

        response.sendRedirect("posttest.jsp?respon=Question has been updated!");
        conn.close();
    }


%>
